<?php
class Login_Model_Forgotaction implements Login_Model_Mainable{
    
    private $core_controller_notnull;
    private $core_controller_tokencheckout;
    private $excepted_result = 1;
    private $current_result;
    private $core_controller_csrftoken;
    private $login_data_updatepassword;
    private $login_data_forgotemail;
    
    public function main(array $variables = null) {
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_notnull->main($variables);
        $this->core_controller_tokencheckout = new Core_Controller_Tokencheckout;
        $this->core_controller_tokencheckout->main($variables);
        $this->core_controller_csrftoken = new Core_Controller_Csrftoken;
        $variables['password'] = $this->core_controller_csrftoken->main($variables);
        $this->login_data_updatepassword = new Login_Data_Updatepassword;
        $this->current_result = $this->login_data_updatepassword->main($variables);
        if(
                $this->current_result == $this->excepted_result
                ){
            $this->login_data_forgotemail = new Login_Data_Forgotemail;
            $this->login_data_forgotemail->main($variables);
            
        }
        header("Location: ".SITE_ROOT."login.html");
    }

}
